<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "quarter_setting".
 *
 * @property integer $id
 * @property string $start_at
 * @property string $end_at
 * @property boolean $is_open
 * @property boolean $is_close
 * @property boolean $is_settle
 * @property string $create_at
 * @property string $update_at
 */
class QuarterSetting extends \app\models\BaseModel {
    /**
     * @inheritdoc
     */
    public static function tableName() {
        return 'quarter_setting';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['start_at', 'end_at', 'is_open', 'is_close', 'is_settle'], 'required'],
            [['is_open', 'is_close', 'is_settle'], 'boolean'],
            [['start_at', 'end_at', 'create_at', 'update_at'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'start_at' => 'Start At',
            'end_at' => 'End At',
            'is_open' => '是否已开启',
            'is_close' => '是否已关闭',
            'is_settle' => '已结算 or 未结算',
            'create_at' => '创建时间',
            'update_at' => '更新时间',
        ];
    }

    public function fields() {
        $fields = [
        ];
        $fields = array_combine($fields, $fields);

        return $fields;
    }

    public function extraFields() {
        $fields = [
            'id',
            'start_at',
            'end_at',
            'is_open',
            'is_close',
            'is_settle',
            'create_at',
            'update_at',
        ];
        $fields = array_combine($fields, $fields);
        return $fields;
    }
}
